/*  Copyright 2010 Daniel Brasil Magnani
 *  Created on: Dec 20, 2010
 *      Author: daniel */

#ifndef TRUNK_CSP_INSTANCE_H_
#define TRUNK_CSP_INSTANCE_H_

#include <limits.h>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#include <algorithm>
#include <ctime>
#include <list>
#include <vector>

struct Constraint {
  int n;
  int p;
  int priority;
};

struct Car{
  int color;
  int64_t identifier;
  float utilization_rate;
  int *constraints;
};

typedef struct {
  int priority;
  int nonpriority;
}Cost;

class Instance {
 public:
  // Initialize the instance
  int Init(char *instance_name);
  // Write solution to output/
  int WriteOutput(const std::vector<Car>& solution);
  // Retrieve the instance name
  char* get_instance_name();
  // Retrieve the paint batch limit
  int get_paint_batch_limit();
  // Retrieve the list of today cars
  const std::vector<Car>& get_today_cars();
  // Retrieve the list of yesterday cars
  const std::vector<Car>& get_yesterday_cars();
  // Retrieve the constraint list
  const std::vector<Constraint>& get_constraint_list();
 private:
  // Read paint_batch_limit.txt
  int ReadPaintInput();
  // Read ratios.txt
  int ReadConstraints();
  // Read vehicles.txt
  int ReadVehicles();

  char instance_name_[256];
  int paint_batch_limit_;
  std::vector<Car> today_cars_;
  std::vector<Car> yesterday_cars_;
  std::vector<Constraint> constraint_list_;
};

#endif  // TRUNK_CSP_INSTANCE_H_
